Scenario #2012: Create External Debitor for Partner

UseCase Create External Debitor For Partner => Debitor: D-3101002 - Test AG - external debitor

Properties

Required

Given

name value
partnerPersonTradeName Test AG
billingContactCaption Billing GmbH - billing department
billingContactEmailAddress billing@test-ag.example.org
debitorNumberSuffix 02
billable true
vatId VAT123456
vatCountryCode DE
vatBusiness true
vatReverseCharge false
defaultPrefix tsy

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // partnerPersonUuid
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

BankAccount: Billing GmbH - refund bank account

HTTP POST "/api/hs/office/bankaccounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "holder" : "Billing GmbH - refund bank account",
  "iban" : "DE02120300000000202051",
  "bic" : "BYLADEM1001"
}
EOF
=> status: 201 CREATED a195657f-5f41-4b2e-8b1b-57b6bcc1288c

Contact: Billing GmbH - Test AG billing

HTTP POST "/api/hs/office/contacts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "caption" : "Billing GmbH, billing for Test AG",
  "emailAddresses" : {
    "main" : "test-ag@billing-GmbH.example.com"
  }
}
EOF
=> status: 201 CREATED b6542f0e-0366-47dd-85d5-9f06a9adcd9e

Create Debitor: D-3101002 - Test AG - external debitor

HTTP POST "/api/hs/office/debitors" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "debitorRel" : {
    "anchor.uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // Person: Test AG
    "holder.uuid" : "064ed503-a82d-4fb0-a7bb-22664f08a882", // Person: Billing GmbH
    "contact.uuid" : "b6542f0e-0366-47dd-85d5-9f06a9adcd9e" // Contact: Billing GmbH - Test AG billing
  },
  "debitorNumberSuffix" : "02",
  "billable" : true,
  "vatId" : "VAT123456",
  "vatCountryCode" : "DE",
  "vatBusiness" : true,
  "vatReverseCharge" : false,
  "refundBankAccount.uuid" : "a195657f-5f41-4b2e-8b1b-57b6bcc1288c", // BankAccount: Billing GmbH - refund bank account
  "defaultPrefix" : "tsy"
}
EOF
=> status: 201 CREATED 83dc3777-eabf-4e24-9331-6562a3e5aabd

generated on 2026-08-10 01:37:52 for branch